<!DOCTYPE html>
<html lang="en">
<title>添加新私教</title>
<#import "/layout/layout.html" as body/>
<@body.page>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title overflow">
                    <h5 class="pull-left">添加新私教</h5>
                </div>
                <div class="ibox-content">
                    <form method="post" class="form-horizontal" name="addForm" id="addForm" action="#">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">私教课程名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" maxlength="50" name="title" id="title" placeholder="请输入不超过50字的课程名称">
                                <span class="help-block m-b-none text-right"><i class="pull-right">0/50</i></span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">上课教练</label>
                            <div class="col-sm-10">
                                <select class="form-control m-b chosen-select" name="coachId" id="coachId">
                                    <option value="-1" readonly>请选择教练</option>
                                    <#if coachList??>
                                        <#list coachList as coach>
                                            <option value="${coach.id}">${coach.nickName!}</option>
                                        </#list>
                                    </#if>
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">课程价格</label>
                            <div class="col-sm-10">
                                <div class="input-group m-b"><span class="input-group-addon">¥</span>
                                    <input name="servicePrice.primePrice" id="primePrice" type="number" class="form-control" placeholder="必填,请输入该课程针对普通用户的课程价格">
                                </div>
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">会员价格</label>
                            <div class="col-sm-10">
                                <div class="input-group m-b"><span class="input-group-addon">¥</span>
                                    <input name="servicePrice.price" id="price" type="number" class="form-control" placeholder="必填,请输入该课程针对围裙健身会员的价格">
                                </div>
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">课时节数</label>
                            <div class="col-sm-10">
                                <div class="m-b checkbox-inline">
                                    <input name="minCount" id="minCount" type="number" min="1" style="width:22em;" class="form-control" placeholder="请设置该课时最少多少课时起卖,最低为1节">
                                </div>
                                <input type="hidden" id="isBuyOneClassLimit" name="isBuyOneClassLimit">
                                <input type="hidden" class="form-control" name="periods" id="periods" >
                                <div class="checkbox-inline i-checks"><label for="buyOne"> <input type="checkbox" id="buyOne" value="0"> &nbsp;是否只能购买1节 </label></div>
                            </div>
                        </div>
						

                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">私教配餐数</label>
                            <div class="col-sm-10">
                                <div class="input-group m-b">
                                    <input name="mealCount" id="mealCount" type="number" min="0" class="form-control" placeholder="请输入该私教课的配餐数量">
                                </div>
                            </div>
                        </div>
						
						<div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">是否设置为年卡私教</label>
                            <div class="col-sm-10">
                                <select class="form-control m-b" name="productServiceDetailId" id="productServiceDetailId">
                                    <option value="0">无</option>
                                    <#if productServiceDetailLists??>
                                        <#list productServiceDetailLists as psd>
                                            <option value="${psd.id}">${psd.productServiceName!}</option>
                                        </#list>
                                    </#if>
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">是否设置为只能购买1次</label>
                            <div class="col-sm-10">
                                <div class="checkbox-inline i-checks"><label for="defaultNo"> <input type="radio" id="defaultNo" value="1" name="isBuyOneTimeLimit" checked >不限 </label></div>
                                <div class="checkbox-inline i-checks"><label for="defaultYes"> <input type="radio" id="defaultYes" value="0" name="isBuyOneTimeLimit" > 限制 </label></div>
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">上课门店</label>
                            <input id="storeId" name="storeId" type="hidden">
                            <div class="col-sm-10">
                                <div id="mgStoreId"></div>
                            </div>
                        </div>


                        <!--<div class="hr-line-dashed"></div>-->
                        <!--<div class="form-group"><label class="col-sm-2 control-label">课时节数</label>-->
                            <!--<div class="col-sm-10">-->
                                <!--<input type="text" class="form-control" name="periods" id="periods" placeholder="请输入课时节数">-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">教练有话说</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" maxlength="50" name="coachComment" id="coachComment" placeholder="最多50字">
                                <span class="help-block m-b-none text-right"><i class="pull-right">0/50</i></span>
                            </div>
                        </div>
                        <!--<div class="hr-line-dashed"></div>-->
                        <!--<div class="form-group"><label class="col-sm-2 control-label">教练微信二维码</label>-->
                            <!--<div class="col-sm-10">-->
                                <!--<div id="qun_qr_code" style="min-height: 150px;" class="dropzone">-->
                                    <!--<input type="hidden" id="qunQRCodePic" name="qunQRCodePic">-->
                                    <!--<div class="dropzone-previews"></div>-->
                                <!--</div>-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <h3 class="col-sm-12 margin-top-5">课程信息
                                <small>(选择课程所属类别后，系统会自动拉取对应的标准课程信息，您可根据需要自行调整文字及图片信息)</small>
                            </h3>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">所属类别</label>
                            <div class="col-sm-10">
                                <select class="form-control m-b" name="courseStandardId" id="courseStandardId">
                                    <option value="0">无</option>
                                    <#if courseStandards??>
                                        <#list courseStandards as courseStandard>
                                            <option value="${courseStandard.id}">${courseStandard.name}</option>
                                        </#list>
                                    </#if>
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">类别介绍文字</label>
                            <div class="col-sm-10">
                                <textarea id="introduce" name="introduce" class="form-control" rows="6" maxlength="600" placeholder="请输入类别介绍"></textarea>
                                <span class="help-block m-b-none">字数不超过600汉字；可分段描述<i class="pull-right">0/600</i></span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">适合人群</label>
                            <div class="col-sm-10">
                                <textarea class="form-control" rows="3" name="crowd" id="crowd" maxlength="600" placeholder="请输入适合人群"></textarea>
                                <span class="help-block m-b-none">字数不超过600汉字；可分段描述<i class="pull-right">0/600</i></span>
                            </div>
                        </div>


                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">属性标签</label>
                            <input id="courseAttr" name="courseAttr" type="hidden">
                            <div class="col-sm-10">
                                <div id="magicsuggest"></div>
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">视频链接</label>
                            <div class="col-sm-10"><input id="link" name="link" type="text" class="form-control" placeholder="请输入视频链接"></div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">视频封面图</label>
                            <div class="col-sm-10">
                                <div id="video_preview" style="min-height: 230px;" class="dropzone">
                                    <input type="hidden" id="url" name="url">
                                    <div class="dropzone-previews"></div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group"><label class="col-sm-2 control-label">类别硬照</label>

                            <div class="col-sm-10">
                                <div id="category_pic" style="min-height: 230px;" class="dropzone">
                                    <input type="hidden" id="categoryPic" name="categoryPic">
                                    <div class="dropzone-previews"></div>
                                </div>
                                <div class="m text-left">
                                    <small>大小不能超过1.5M;必须大于两张，且总数为偶数。</small>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="ibox-content overflow">
                    <div class="col-sm-12">
                        <button type="button" onclick="goBackList()" class="btn btn-default pull-left">取消添加</button>
                        <button type="button" class="btn btn-primary pull-right" onclick="formSubmit()">确认创建</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<link href="${baseUrl}css/plugins/clockpicker/clockpicker.css" rel="stylesheet">
<link href="${baseUrl}css/plugins/magicsuggest/magicsuggest-min.css" rel="stylesheet">
<!--upload-->
<script type="text/javascript" src="${baseUrl}js/upload/promise.min.js"></script>
<script type="text/javascript" src="${baseUrl}js/upload/aliyun-oss-sdk.min.js"></script>
<script type="text/javascript" src="${baseUrl}js/upload/webToOss.js"></script>
<!--<script src="${baseUrl}js/jquery.limitTextarea.js"></script>-->
<script src="${baseUrl}js/plugins/dropzone/dropzone.js"></script>
<script src="${baseUrl}js/plugins/clockpicker/clockpicker.js"></script>

<script>
    var ms = null;//下拉插件
    var msStore = null;//门店下拉插件
    var dictArr = new Array();//属性标签暂存
    var dataDictList = ${dataDictList!};
    var storeArr = new Array();//门店暂存
    var storeList = ${storeList!};//门店
    var headImgPicList = new Array();//标题背景图
    var qrcodePicList = new Array();//群QRCODE
    var videoLinkPicList = new Array();//视频封面
    var categoryPicList = new Array();//类别硬照
    var courseStandard;
    var myDropzone1;
    var myDropzone2;
    var myDropzone3;
	
    //返回列表方法
    function goBackList() {
        window.location = "to_course_secret";
    }

    function formSubmit() {

        var isCheck = true;
//        debugger;
//      //校验表单
        if ($("#title").val().length === 0) {
            swal("错误!", "请先填写私教课程名称!", "error");
            isCheck = false;
            return false;
        }
        if ($("#primePrice").val().length === 0) {
            swal("错误!", "请先输入课程费用!", "error");
            isCheck = false;
            return false;
        }
        
        if ($("#price").val().length === 0) {
            swal("错误!", "请先输入课程会员费用!", "error");
            isCheck = false;
            return false;
        }
        $('#storeId').val(storeArr.toString());
        if ($("#storeId").val().length === 0) {
            swal("错误!", "请先选择上课门店!", "error");
            isCheck = false;
            return false;
        }
//        if ($("#periods").val().length <= 0) {
//            swal("错误!", "请先输入上课节数!", "error");
//            isCheck = false;
//            return false;
//        }

        if ($("#coachComment").val().length === 0) {
            swal("错误!", "请先输入教练有话说!", "error");
            isCheck = false;
            return false;
        }
//        $("#qunQRCodePic").val(qrcodePicList.join(","));
//        if ($("#qunQRCodePic").val().length <= 0) {
//            swal("错误!", "请先上传教练微信二维码!", "error");
//            isCheck = false;
//            return false;
//        } else {
//            $("#qunQRCodePic").val(qrcodePicList.join(","));
//            if ($("#qunQRCodePic").val().split(",").length != 1) {
//                swal("错误!", "请先确定上传1张数量的教练微信二维码!", "error");
//                isCheck = false;
//                return false;
//            }
//        }
        if ($("#introduce").val().length === 0) {
            swal("错误!", "请先输入类别介绍文字!", "error");
            isCheck = false;
            return false;
        }
        if ($("#crowd").val().length === 0) {
            swal("错误!", "请先输入适合人群!", "error");
            isCheck = false;
            return false;
        }
//            debugger
        $("#courseAttr").val(dictArr.toString());
        if ($("#courseAttr").val().length === 0) {
            swal("错误!", "请先选择属性标签!", "error");
            isCheck = false;
            return false;
        }
        /*         if($('#courseStandardId').val()!=''){
         //标准课程为空时不校验视频链接/视频封面图
         if($("#link").val().length<=0) {
         swal("错误!", "请先输入视频链接!", "error");
         isCheck = false;
         return false;
         }
         $("#url").val(videoLinkPicList.join(","));
         if($("#url").val().length<=0) {
         swal("错误!", "请先上传视频封面图!", "error");
         isCheck = false;
         return false;
         } else {
         if ($("#url").val().split(",").length != 1) {
         swal("错误!", "请先确定上传1张数量的视频封面图!", "error");
         isCheck = false;
         return false;
         }
         }
         } */

        $("#url").val(videoLinkPicList.join(","));
        if (videoLinkPicList.length > 0 && videoLinkPicList.length != 1) {
            swal("错误!", "请先确定上传1张数量的视频封面图!", "error");
            isCheck = false;
            return false;
        }

        $("#categoryPic").val(categoryPicList.join(","));
        if ($("#categoryPic").val().length === 0) {
            swal("错误!", "请先上传类别硬照!", "error");
            isCheck = false;
            return false;
//        } else {
//            if ($("#categoryPic").val().split(",").length % 2 != 0) {
//                swal("错误!", "请先上传偶数量的类别硬照!", "error");
//                isCheck = false;
//                return false;
//            }
        }

        if ($("#minCount").val().length === 0) {
            $("#minCount").val(1);
        }

        var periods = $("#minCount").val();

        $("#periods").val(periods);

        var param = $("#addForm").serialize();
        debugger;
        if (!isCheck) {
            return false;
        }
        $.ajax({
            type: "post",
            url: "course_sercet_save",
            data: param,
            success: function (data) {
                if (data == "success") {
                    swal("保存成功!", "页面即将重新加载,请稍后...", "success");
                    window.setTimeout(function () {
                        window.location = "to_course_secret"
                    }, 1000);
                } else {
                    swal("保存失败!", "...", "fail");
                }
            }
        });

    }

    $(document).ready(function () {

        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green'
        });

        var count = 1;
        $('#buyOne').on('ifChecked', function () {
            count = $("#minCount").val();
            $("#minCount").val("1").attr("readonly", true);
            $('#isBuyOneClassLimit').val(0);
        });
        $('#buyOne').on('ifUnchecked', function () {
            $("#minCount").val(count).attr("readonly",false);
            $('#isBuyOneClassLimit').val(1);
        });

        //下拉选择
        ms = $('#magicsuggest').magicSuggest({
            data: dataDictList,
            placeholder: '请输入搜索或选择',
            required: true,
            expandOnFocus: true,
            strictSuggest: true,
            displayField: 'dictName',
            valueField: 'dictName'
        });

        dictArr = ms.getValue();

        $(ms).on('selectionchange', function () {
            console.log('DATA---->>' + JSON.stringify(this.getValue()));
            dictArr = this.getValue();
        });

        msStore = $('#mgStoreId').magicSuggest({
            data: storeList,
            placeholder: '请输入搜索或选择',
            required: true,
            expandOnFocus: true,
            strictSuggest: true,
            displayField: 'storeName',
            valueField: 'id'
        });

        storeArr = msStore.getValue();

        $(msStore).on('selectionchange', function () {
            console.log('DATA---->>' + JSON.stringify(this.getValue()));
            storeArr = this.getValue();
        });
        
        
        //截止报名时间
        $('.input-group.date').datepicker({
            todayBtn: "linked",
            keyboardNavigation: false,
            forceParse: false,
            calendarWeeks: true,
            autoclose: true
        });
        //$('.clockpicker').clockpicker();
        //分页
        new Page({
            parent: $("#copot-page"),
            nowPage: 5,
            pageSize: 5,
            totalCount: 100,
            setting: {
                defaultPage: 5,//默认显示可点击分页的个数
                firstPageText: "首页",
                prevPageText: "上一页",
                nextPageText: "下一页",
                lastPageText: "尾页"
            },
            callback: function (nowPage, totalPage) {
                alert("当前" + nowPage + "页--总共有" + totalPage + "页")
            }
        });

//        // Multi select//属性标签
//        var config = {
//            '.chosen-select': {},
//            '.chosen-select-deselect': {
//                allow_single_deselect: true
//            },
//            '.chosen-select-no-single': {
//                disable_search_threshold: 10
//            },
//            '.chosen-select-no-results': {
//                no_results_text: 'Oops, nothing found!'
//            },
//            '.chosen-select-width': {
//                width: "95%"
//            }
//        }
//        for (var selector in config) {
//            $(selector).chosen(config[selector]);
//        }

        Dropzone.autoDiscover = false;

        //视频封面图
        myDropzone2 = new Dropzone("#video_preview", {
            url: "upload_pic",
            uploadMultiple: false,
            addRemoveLinks: true,
            dictDefaultMessage: "将文件拖到此处上传",
            dictFileTooBig: "文件过大",
            dictCancelUpload: "取消上传",
            dictRemoveFile: "移除文件",
            dictMaxFilesExceeded: "超过上传文件数量限制",
            maxFiles: 1,
            maxFilesize: 10.5,
            acceptedFiles: ".jpg,.jpeg,.png",
            method: 'post',
            filesizeBase: 1024,

            init: function () {

//              var url = $("#url").val();
//              if (!url || url.length <= 0) {
//                  url = "";
//              } else {
//                  var larr = url.split(",");
//                  if (larr.length >0){
//                      for(var i=0;i<larr.length;i++){
//                          videoLinkPicList.push(larr[i]);
//                      }
//                  }
//              }
//              this.emit("initimage", url);
                this.on("error", function (file, response, XMLHttpRequest) {
                    //debugger
                    swal("图片上传异常!", "图片服务器出错,即将清除无效图片,请稍后重新上传...", "error");
                    window.setTimeout(function () {
                        $('#video_preview .dz-image-preview.dz-error').remove()
                    }, 1000);
                });
                this.on("success", function (file, response, e) {
                    if (response.error) {
                        $(file.previewTemplate).children('.dz-error-mark').css('opacity', '1')
                    } else {
                        videoLinkPicList.push(response.url);
                    }
                });
                this.on("sending", function (file, xhr, formData) {
                    formData.append("filesize", file.size);
                });
                this.on("removedfile", function (file) {
                    var responseJson = null;
                    if (file && file.xhr && file.xhr.responseText) {
                        responseJson = $.parseJSON(file.xhr.responseText);
                    }
                    if (responseJson) {
                        $.each(videoLinkPicList, function (i, data) {
                            if (videoLinkPicList[i].indexOf(responseJson.url) > -1) {
                                videoLinkPicList.splice(i, 1);
                            }
                        });
                    }
                    if (file.name.length > 0) {
                        $.each(videoLinkPicList, function (i, data) {
                            if (videoLinkPicList[i].indexOf(file.name) > -1) {
                                videoLinkPicList.splice(i, 1);
                            }
                        });
                    }
                    console.log("文件 " + file.name + " 被移除");
                });
            }
        });

        //类别硬照
        myDropzone3 = new Dropzone("#category_pic", {
            url: "upload_pic",
            uploadMultiple: false,
            addRemoveLinks: true,
            dictDefaultMessage: "将文件拖到此处上传",
            dictFileTooBig: "文件过大",
            dictCancelUpload: "取消上传",
            dictRemoveFile: "移除文件",
            maxFilesize: 10.5,
            acceptedFiles: ".jpg,.jpeg,.png",
            method: 'post',
            filesizeBase: 1024,

            init: function () {
//              var url = $("#categoryPic").val();
//              if (!url || url.length <= 0) {
//                  url = "";
//              }else{
//                  var larr = url.split(",");
//                  if (larr.length >0){
//                      for(var i=0;i<larr.length;i++){
//                          categoryPicList.push(larr[i]);
//                      }
//                  }
//              }
//              this.emit("initimage", url);
                this.on("error", function (file, response, XMLHttpRequest) {
                    //debugger
                    swal("图片上传异常!", "图片服务器出错,即将清除无效图片,请稍后重新上传...", "error");
                    window.setTimeout(function () {
                        $('#category_pic .dz-image-preview.dz-error').remove()
                    }, 1000);
                });
                this.on("success", function (file, response, e) {
                    if (response.error) {
                        $(file.previewTemplate).children('.dz-error-mark').css('opacity', '1')
                    } else {
                        categoryPicList.push(response.url);
                    }
                });
                this.on("sending", function (file, xhr, formData) {
                    formData.append("filesize", file.size);
                });
                this.on("removedfile", function (file) {
                    var responseJson = null;
                    if (file && file.xhr && file.xhr.responseText) {
                        responseJson = $.parseJSON(file.xhr.responseText);
                    }
                    if (responseJson) {
                        $.each(categoryPicList, function (i, data) {
                            if (categoryPicList[i].indexOf(responseJson.url) > -1) {
                                categoryPicList.splice(i, 1);
                            }
                        });
                    }
                    if (file.name.length > 0) {
                        $.each(categoryPicList, function (i, data) {
                            if (categoryPicList[i].indexOf(file.name) > -1) {
                                categoryPicList.splice(i, 1);
                            }
                        });
                    }
                    console.log("文件 " + file.name + " 被移除");
                });
            }
        });

        $('.form_datetime').datetimepicker({
            language: 'zh-CN',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            showMeridian: 0
        });

        //    loadStandard($("#courseStandardId").children('option:selected').val(), false);

        bindEventer('title', 50);
        bindEventer('coachComment', 50);
        bindEventer('introduce', 600);
        bindEventer('crowd', 600);

        $("#title, #coachComment, #introduce, #crowd").trigger("keyup");
    });


    //动态改变基础课程值
    $("#courseStandardId").change(function () {

        //debugger;
        var id = $(this).children('option:selected').val();

        if (id == '0') {
            //为空清空标准课程
            $('#url').val('');
            $('#introduce').val('');
            $('#crowd').val('');
            $('#link').val('');
            ms.clear();
            ms.collapse();
            $('#video_preview .dz-image-preview').remove();
            videoLinkPicList = new Array;
            $('#category_pic .dz-image-preview').remove();
            categoryPicList = new Array;
        } else {
            loadStandard(id, false);
        }

    })
    /**
     * 读取标准课程数据
     * @param id
     * @param isFirst
     */
    function loadStandard(id, isFirst) {
        $.ajax({
            type: "post",
            url: "course_standard",
            data: {"id": id},
            success: function (data) {
                courseStandard = $.parseJSON(data);
                if (courseStandard) {
                    if (!isFirst) {//非第一次进入调用才更新标准课程关联字段

                        $("#introduce").val(courseStandard.introduce).trigger("keyup");
                        $("#crowd").val(courseStandard.crowd).trigger("keyup");
                        $("#link").val(courseStandard.link);
                        $("#video_preview .dz-image-preview, #category_pic .dz-image-preview").remove();
                        videoLinkPicList = new Array;
                        if (courseStandard.url && courseStandard.url.length > 0) {
                            videoLinkPicList.push(courseStandard.url);
                            var mockFile = {name: courseStandard.url, accepted: true};
                            myDropzone2.emit("addedfile", mockFile);
                            myDropzone2.emit("thumbnail", mockFile, courseStandard.url);
                            myDropzone2.emit("complete", mockFile);
                        }
                        categoryPicList = new Array();
                        if (courseStandard.categoryPic && courseStandard.categoryPic.length > 0) {
                            var urlArr = courseStandard.categoryPic.split(",");
                            for (var i = 0; i < urlArr.length; i++) {
                                categoryPicList.push(urlArr[i]);
                                var mockFile = {name: urlArr[i], accepted: true};
                                myDropzone3.emit("addedfile", mockFile);
                                myDropzone3.emit("thumbnail", mockFile, urlArr[i]);
                                myDropzone3.emit("complete", mockFile);
                            }
                        }
                        if (courseStandard.courseAttr && courseStandard.courseAttr.length > 0) {
                            var cd = courseStandard.courseAttr.split("#");
                            ms.clear();
                            ms.setValue(cd);
                            ms.collapse();
                        } else {
                            ms.clear();
                            ms.collapse();
                        }
                    }
                }
            }
        });
    }


</script>

</@body.page>
</html>